package com.wishu.finance.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 租约保理申请表
 *
 * @TableName t_jr_factoring
 */
@TableName(value = "t_jr_factoring")
@Data
public class TJrFactoring implements Serializable {
    /**
     * 主键id
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 租约保理申请单号
     */
    private String factoringOrderNo;

    /**
     * 外部合同号
     */
    private String outOrderNo;

    /**
     * 商户id
     */
    private String businessId;

    /**
     * 利率，年利率，单位：百分比
     */
    private BigDecimal rate;

    /**
     * 借款金额
     */
    private BigDecimal loanAmount;

    /**
     * 借款期限，单位：月
     */
    private Integer monthLimit;

    /**
     * 一次性服务费，单位：百分比
     */
    private BigDecimal serviceFee;

    /**
     * 金融产品ID
     */
    private Long jrProductId;

    /**
     * 资方ID
     */
    private Long capitalId;

    /**
     * 资方名称
     */
    private String capitalName;

    /**
     * 应收租约合计
     */
    private BigDecimal rentMoney;

    /**
     * 保理授信金额合计
     */
    private BigDecimal factoringCreditMoney;

    /**
     * 服务费
     */
    private BigDecimal serviceMoney;

    /**
     * 保理利息合计
     */
    private BigDecimal factoringAdditionalMoney;

    /**
     * 实收保理金额
     */
    private BigDecimal factoringTrueMoney;

    /**
     * 备注
     */
    private String remark;

    /**
     * 审核备注
     */
    private String auditMemo;

    /**
     * 申请状态，1:申请中，2：初审通过，3：初审不通过，4：复审通过，5：复审不通过
     */
    private Integer applyState;

    /**
     * 预留字段1
     */
    private BigDecimal reserve1;

    /**
     * 预留字段2
     */
    private Integer reserve2;

    /**
     * 预留字段3
     */
    private String reserve3;

    /**
     * 预留字段4
     */
    private String reserve4;

    /**
     * 预留字段5
     */
    private String reserve5;

    /**
     * 删除标识，0：删除 ，1：未删除
     */
    private Integer delFlg;

    /**
     * 创建用户id
     */
    private Long createUserid;

    /**
     * 创建用户时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date createTime;

    /**
     * 更新用户id
     */
    private Long updateUserid;

    /**
     * 更新用户时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date updateTime;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        TJrFactoring other = (TJrFactoring) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
                && (this.getFactoringOrderNo() == null ? other.getFactoringOrderNo() == null : this.getFactoringOrderNo().equals(other.getFactoringOrderNo()))
                && (this.getOutOrderNo() == null ? other.getOutOrderNo() == null : this.getOutOrderNo().equals(other.getOutOrderNo()))
                && (this.getBusinessId() == null ? other.getBusinessId() == null : this.getBusinessId().equals(other.getBusinessId()))
                && (this.getRate() == null ? other.getRate() == null : this.getRate().equals(other.getRate()))
                && (this.getLoanAmount() == null ? other.getLoanAmount() == null : this.getLoanAmount().equals(other.getLoanAmount()))
                && (this.getMonthLimit() == null ? other.getMonthLimit() == null : this.getMonthLimit().equals(other.getMonthLimit()))
                && (this.getServiceFee() == null ? other.getServiceFee() == null : this.getServiceFee().equals(other.getServiceFee()))
                && (this.getJrProductId() == null ? other.getJrProductId() == null : this.getJrProductId().equals(other.getJrProductId()))
                && (this.getCapitalId() == null ? other.getCapitalId() == null : this.getCapitalId().equals(other.getCapitalId()))
                && (this.getCapitalName() == null ? other.getCapitalName() == null : this.getCapitalName().equals(other.getCapitalName()))
                && (this.getRentMoney() == null ? other.getRentMoney() == null : this.getRentMoney().equals(other.getRentMoney()))
                && (this.getFactoringCreditMoney() == null ? other.getFactoringCreditMoney() == null : this.getFactoringCreditMoney().equals(other.getFactoringCreditMoney()))
                && (this.getServiceMoney() == null ? other.getServiceMoney() == null : this.getServiceMoney().equals(other.getServiceMoney()))
                && (this.getFactoringAdditionalMoney() == null ? other.getFactoringAdditionalMoney() == null : this.getFactoringAdditionalMoney().equals(other.getFactoringAdditionalMoney()))
                && (this.getFactoringTrueMoney() == null ? other.getFactoringTrueMoney() == null : this.getFactoringTrueMoney().equals(other.getFactoringTrueMoney()))
                && (this.getRemark() == null ? other.getRemark() == null : this.getRemark().equals(other.getRemark()))
                && (this.getAuditMemo() == null ? other.getAuditMemo() == null : this.getAuditMemo().equals(other.getAuditMemo()))
                && (this.getApplyState() == null ? other.getApplyState() == null : this.getApplyState().equals(other.getApplyState()))
                && (this.getReserve1() == null ? other.getReserve1() == null : this.getReserve1().equals(other.getReserve1()))
                && (this.getReserve2() == null ? other.getReserve2() == null : this.getReserve2().equals(other.getReserve2()))
                && (this.getReserve3() == null ? other.getReserve3() == null : this.getReserve3().equals(other.getReserve3()))
                && (this.getReserve4() == null ? other.getReserve4() == null : this.getReserve4().equals(other.getReserve4()))
                && (this.getReserve5() == null ? other.getReserve5() == null : this.getReserve5().equals(other.getReserve5()))
                && (this.getDelFlg() == null ? other.getDelFlg() == null : this.getDelFlg().equals(other.getDelFlg()))
                && (this.getCreateUserid() == null ? other.getCreateUserid() == null : this.getCreateUserid().equals(other.getCreateUserid()))
                && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
                && (this.getUpdateUserid() == null ? other.getUpdateUserid() == null : this.getUpdateUserid().equals(other.getUpdateUserid()))
                && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getFactoringOrderNo() == null) ? 0 : getFactoringOrderNo().hashCode());
        result = prime * result + ((getOutOrderNo() == null) ? 0 : getOutOrderNo().hashCode());
        result = prime * result + ((getBusinessId() == null) ? 0 : getBusinessId().hashCode());
        result = prime * result + ((getRate() == null) ? 0 : getRate().hashCode());
        result = prime * result + ((getLoanAmount() == null) ? 0 : getLoanAmount().hashCode());
        result = prime * result + ((getMonthLimit() == null) ? 0 : getMonthLimit().hashCode());
        result = prime * result + ((getServiceFee() == null) ? 0 : getServiceFee().hashCode());
        result = prime * result + ((getJrProductId() == null) ? 0 : getJrProductId().hashCode());
        result = prime * result + ((getCapitalId() == null) ? 0 : getCapitalId().hashCode());
        result = prime * result + ((getCapitalName() == null) ? 0 : getCapitalName().hashCode());
        result = prime * result + ((getRentMoney() == null) ? 0 : getRentMoney().hashCode());
        result = prime * result + ((getFactoringCreditMoney() == null) ? 0 : getFactoringCreditMoney().hashCode());
        result = prime * result + ((getServiceMoney() == null) ? 0 : getServiceMoney().hashCode());
        result = prime * result + ((getFactoringAdditionalMoney() == null) ? 0 : getFactoringAdditionalMoney().hashCode());
        result = prime * result + ((getFactoringTrueMoney() == null) ? 0 : getFactoringTrueMoney().hashCode());
        result = prime * result + ((getRemark() == null) ? 0 : getRemark().hashCode());
        result = prime * result + ((getAuditMemo() == null) ? 0 : getAuditMemo().hashCode());
        result = prime * result + ((getApplyState() == null) ? 0 : getApplyState().hashCode());
        result = prime * result + ((getReserve1() == null) ? 0 : getReserve1().hashCode());
        result = prime * result + ((getReserve2() == null) ? 0 : getReserve2().hashCode());
        result = prime * result + ((getReserve3() == null) ? 0 : getReserve3().hashCode());
        result = prime * result + ((getReserve4() == null) ? 0 : getReserve4().hashCode());
        result = prime * result + ((getReserve5() == null) ? 0 : getReserve5().hashCode());
        result = prime * result + ((getDelFlg() == null) ? 0 : getDelFlg().hashCode());
        result = prime * result + ((getCreateUserid() == null) ? 0 : getCreateUserid().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateUserid() == null) ? 0 : getUpdateUserid().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", factoringOrderNo=").append(factoringOrderNo);
        sb.append(", outOrderNo=").append(outOrderNo);
        sb.append(", businessId=").append(businessId);
        sb.append(", rate=").append(rate);
        sb.append(", loanAmount=").append(loanAmount);
        sb.append(", monthLimit=").append(monthLimit);
        sb.append(", serviceFee=").append(serviceFee);
        sb.append(", jrProductId=").append(jrProductId);
        sb.append(", capitalId=").append(capitalId);
        sb.append(", capitalName=").append(capitalName);
        sb.append(", rentMoney=").append(rentMoney);
        sb.append(", factoringCreditMoney=").append(factoringCreditMoney);
        sb.append(", serviceMoney=").append(serviceMoney);
        sb.append(", factoringAdditionalMoney=").append(factoringAdditionalMoney);
        sb.append(", factoringTrueMoney=").append(factoringTrueMoney);
        sb.append(", remark=").append(remark);
        sb.append(", auditMemo=").append(auditMemo);
        sb.append(", applyState=").append(applyState);
        sb.append(", reserve1=").append(reserve1);
        sb.append(", reserve2=").append(reserve2);
        sb.append(", reserve3=").append(reserve3);
        sb.append(", reserve4=").append(reserve4);
        sb.append(", reserve5=").append(reserve5);
        sb.append(", delFlg=").append(delFlg);
        sb.append(", createUserid=").append(createUserid);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateUserid=").append(updateUserid);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}